package com.example.controller;

import com.example.common.Result;
import com.example.entity.PetCheckUpInfo;
import com.example.service.PetCheckUpInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author HY
 * @date 2025/2/18
 */
@RestController
@RequestMapping("/petCheckUpInfo")
public class PetCheckUpInfoController {
    @Autowired
    private PetCheckUpInfoService petCheckUpInfoService;
    @GetMapping("list")
    public Result list(Integer pageSize, Integer pageNum) {
        PageInfo<PetCheckUpInfo> pageInfo = petCheckUpInfoService.listPage(pageSize, pageNum);
        return Result.success(pageInfo);
    }

    @PostMapping("save")
    public Result save(@RequestBody PetCheckUpInfo petCheckUpInfo) {
        petCheckUpInfoService.save(petCheckUpInfo);
        return Result.success();
    }

    @DeleteMapping("delete/{id}")
    public Result delete(@PathVariable Integer id) {
        petCheckUpInfoService.delete(id);
        return Result.success();
    }
}
